// 封装本地存储token模块
const tokenKey = 'hm-mobile-78-token'
// 历史记录的存储
const historyKey = 'hm-mobile-78-history'
// 存储token
export const setToken = (tokenInfo) => {
  localStorage.setItem(tokenKey, JSON.stringify(tokenInfo))
}
// 获取token
export const getToken = () => {
  return JSON.parse(localStorage.getItem(tokenKey))
}
// 删除token
export const removeToken = () => {
  localStorage.removeItem(tokenKey)
}

// 历史记录存储
export const setHistory = (history) => {
  localStorage.setItem(historyKey, JSON.stringify(history))
}
// 获取历史
export const getHistory = () => {
  return JSON.parse(localStorage.getItem(historyKey))
}
// 移除历史
export const removeHistory = () => {
  localStorage.removeItem(historyKey)
}
